﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace S.Eartag.Infrastructure.Migrations
{
    public partial class ino : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "OldEarTag",
                table: "Mark",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "NewEarTag",
                table: "Mark",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "EarNumber",
                table: "Mark",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "EarNumber",
                table: "LamBing",
                type: "nvarchar(50)",
                maxLength: 50,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.CreateTable(
                name: "SheepFile",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    VisualEarSignal = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    ElectronicEarNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    breed = table.Column<int>(type: "int", nullable: true),
                    Sex = table.Column<bool>(type: "bit", nullable: true),
                    Birthday = table.Column<DateTime>(type: "datetime2", nullable: true),
                    AgeDays = table.Column<int>(type: "int", nullable: true),
                    AgeMoon = table.Column<int>(type: "int", nullable: true),
                    presence = table.Column<int>(type: "int", nullable: true),
                    growthStage = table.Column<int>(type: "int", nullable: true),
                    sheepType = table.Column<int>(type: "int", nullable: true),
                    Cottage = table.Column<int>(type: "int", nullable: false),
                    Field = table.Column<int>(type: "int", nullable: false),
                    reproductiveState = table.Column<int>(type: "int", nullable: true),
                    PregnancyTest = table.Column<bool>(type: "bit", nullable: true),
                    StatusDays = table.Column<int>(type: "int", nullable: true),
                    productionGrade = table.Column<int>(type: "int", nullable: true),
                    salesGrade = table.Column<int>(type: "int", nullable: true),
                    geneClass = table.Column<int>(type: "int", nullable: true),
                    BirthWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WeaningWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WeaningDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WeaningAge = table.Column<int>(type: "int", nullable: true),
                    FatherHorn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FemaleHorn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepFile", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SheepFile");

            migrationBuilder.AlterColumn<string>(
                name: "OldEarTag",
                table: "Mark",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "NewEarTag",
                table: "Mark",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "EarNumber",
                table: "Mark",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "EarNumber",
                table: "LamBing",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(50)",
                oldMaxLength: 50,
                oldNullable: true);
        }
    }
}
